package com.wangyadong.hobby.concurrent;

import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicStampedReference;

public class AtomicStampReferenceTest {
    public static void main(String[] args) {
        AtomicStampedReference<String> stampedReference = new AtomicStampedReference("Hello", 1);
        if (stampedReference.compareAndSet("Hello", "wyd", 1, 2)) {
            int[] ints = new int[2];
            String o = stampedReference.get(ints);
            System.out.println(ints[0]);
            System.out.println(o);
        }
    }
}
